package com.sinopec.basemodule.contract

import com.sinopec.basemodule.base.BaseView
import com.sinopec.basemodule.base.baseImpl.BasePresenterImpl

/**
 * create by lwj at 2023/3/1
 * 盘库 '续命' 契约
 * 开始盘点 告知后台该盘库单被设备占用了 (如果11分钟内没有操作 会自动更新盘库单为待盘点)(v1.0.22.4)
 */
interface InventoryStartContract {

    interface View : BaseView {

        /**
         * create by lwj at 2023/3/1
         * 续命成功
         */
        fun inventoryStartResult(
            boolean: Boolean,
            /**
             * create by lwj at 2023/3/1
             * 非必须字段 用于区分调用处用途
             */
            tag: String = ""
        )

        /**
         * create by lwj at 2023/3/1
         * 续命失败
         */
        fun inventoryStartError(
            throwable: Throwable?,
            /**
             * create by lwj at 2023/3/1
             * 非必须字段 用于区分调用处用途
             */
            tag: String = ""
        )
    }

    abstract class Presenter(view: View?) : BasePresenterImpl<View>(view) {

        /**
         * create by lwj at 2023/3/1
         * 续命
         */
        abstract fun inventoryAction(
            //共享盘库单id
            id: String,
            //类型 1共享 2自营
            type: String,
            //设备号
            equipmentCode: String,

            /**
             * create by lwj at 2023/3/1
             * 非必须字段 用于区分调用处用途
             */
            tag: String = ""
        )

    }

}